<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  var obj = new Object();
  obj.name = "华仔"
  obj.age = 18;
  //定义方法
  //使用new操作符将会直接执行方法
    obj.fun= function (){
    alert(obj.name+"年龄"+obj.age);
  }
  obj.fun();
</script>
</body>
</html>
